Total Complexity | 1 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import React from "react" |
||
14 | class Card extends React.Component<CardProps, {}> { |
||
15 | public static defaultProps = { |
||
16 | className: "", |
||
17 | hasTable: false, |
||
18 | titleIcon: "", |
||
19 | } |
||
20 | |||
21 | render(): JSX.Element { |
||
22 | return ( |
||
23 | <article |
||
24 | className={classNames("card", this.props.className, { |
||
25 | "card--has-table": this.props.hasTable, |
||
26 | })} |
||
27 | > |
||
28 | <header className={"card__header"}> |
||
29 | <h4> |
||
30 | {this.props.titleIcon !== "" && ( |
||
31 | <Icon icon={this.props.titleIcon} /> |
||
32 | )}{" "} |
||
33 | {this.props.title} |
||
34 | </h4> |
||
35 | </header> |
||
36 | <div className={"card__content"}>{this.props.children}</div> |
||
37 | </article> |
||
38 | ) |
||
43 |